﻿<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>

<form name="form1" method="POST" action="<?= $APPLICATION->GetCurPage(); ?>" enctype="multipart/form-data">
<input type="hidden" name="ID" value="<?= $arResult["ID"]; ?>">
<input type="hidden" name="action" value="newmessage">

<!-- записываем текущие параметры заявки, для отслеживания изменений -->
<input type="hidden" name="CATEGORY_ID_OLD" value="<?= $arResult["PROPERTY_CATEGORY_VALUE"]; ?>">
<input type="hidden" name="RESPONSIBLE_USER_ID_OLD" value="<?= $arResult["PROPERTY_RESPONSIBLE_USER_VALUE"]; ?>">
<input type="hidden" name="STATUS_ID_OLD" value="<?= $arResult["PROPERTY_STATUS_VALUE"]; ?>">
<input type="hidden" name="DIFFICULTY_ID_OLD" value="<?= $arResult["PROPERTY_DIFFICULTY_VALUE"]; ?>">
<input type="hidden" name="CRITICALITY_ID_OLD" value="<?= $arResult["PROPERTY_CRITICALITY_VALUE"]; ?>">
<input type="hidden" name="MARK_ID_OLD" value="<?= $arResult["PROPERTY_MARK_VALUE"]; ?>">
<input type="hidden" name="PROJECT_ID_OLD" value="<?= $arResult["PROPERTY_PROJECT_VALUE"]; ?>">
<!-- // записываем текущие параметры заявки, для отслеживания изменений -->

<div class="suport-edit-form">
    <table cellpadding="0" cellspacing="0" border="0" width="100%" class="support-edit-form">
        <tr class="top">
            <td class="left"><div class="empty"></div></td>
            <td><div class="empty"></div></td>
            <td class="right"><div class="empty"></div></td>
	</tr>
	<tr>
            <td class="left"><div class="empty"></div></td>
            <td class="content">
                <table cellspacing="0" class="support-edit-tabs" width="100%">
                    <tr>
                        <!--td class="tab-indent"><div class="empty"></div></td>
                        <!--td title="Неисправен принтер" id="tab_cont_edit1" class="tab-container-selected" onclick="tabControl.SelectTab('edit1');" onmouseover="if(window.tabControl){tabControl.HoverTab('edit1', true);}" onmouseout="if(window.tabControl){tabControl.HoverTab('edit1', false);}">
						<table cellspacing="0">
							<tbody><tr>
								<td class="tab-left-selected" id="tab_left_edit1"><div class="empty"></div></td>
								<td class="tab-selected" id="tab_edit1">Обращение</td>
								<td class="tab-right-last-selected" id="tab_right_edit1"><div class="empty"></div></td>
							</tr>
						</tbody></table>
                        </td-->
                        <td width="100%"><div class="empty"></div></td>
                    </tr>
		</table>
                <table cellspacing="0" class="support-edit-tab">
                    <tr>
                        <td>
                            <div id="edit1" class="edit-tab-inner">
                                <div style="height: 100%;">
                                    <table cellpadding="0" cellspacing="0" border="0" class="support-edit-tab-title">
                                        <tr style="display:none;">
                                            <td colspan="2" class="delimiter delimiter-top"><div class="empty"></div></td>
                                        </tr>
                                        <tr>
                                            <td class="icon"><div id="ticket_edit"></div></td>
                                            <td class="title"><?= $arResult["NAME"]; ?></td>
                                        </tr>
                                        <tr>
                                            <td colspan="2" class="delimiter"><div class="empty"></div></td>
                                        </tr>
                                    </table>
                                    <table cellpadding="0" cellspacing="0" border="0" class="support-edit-table" id="edit1_edit_table">
                                        <tr>
                                            <td colspan="2">
                                                <div style="width: 50%; float: left;">
                                                <table cellpadding="0" cellspacing="0" border="0" class="support-edit-table" id="edit1_edit_table">
                                                    <tr>
                                                        <td valign="top" align="right" width="20%" nowrap="" class="field-name">Автор:</td>
                                                        <td width="80%"><?= $arResult["CREATOR"]["NAME"]; ?> <?= $arResult["CREATOR"]["LAST_NAME"]; ?><br /><font color="gray"><?= $arResult["CREATOR"]["DEPARTMENT"]; ?>, <?= strtolower($arResult["CREATOR"]["WORK_POSITION"]); ?>, комната <?= $arResult["CREATOR"]["UF_ROOM"]; ?>, телефон <?= $arResult["CREATOR"]["UF_PHONE_INNER"]; ?></font></td>
                                                    </tr>
                                                    <tr valign="middle">
                                                        <td align="right" width="20%" class="field-name">Создано:</td>
                                                        <td align="left" width="80%"><?= $arResult["DATE_CREATE"]; ?>&nbsp;&nbsp;&nbsp;<?= $arResult["CREATOR"]["NAME"]; ?> <?= $arResult["CREATOR"]["LAST_NAME"]; ?></td>
                                                    </tr>
                                                    <? if (strlen($arResult["LAST_DATE"])): ?>
                                                    <tr valign="middle">
                                                        <td align="right" width="20%" class="field-name">Изменено:</td>
                                                        <td align="left" width="80%"><?= $arResult["LAST_DATE"]; ?>&nbsp;&nbsp;&nbsp;<?= $arResult["LAST_USER"]; ?></td>
                                                    </tr>
                                                    <? endif; ?>
                                                    <? if ($arResult["RESPONSINLE_USER"]["ID"]): ?>
                                                    <tr valign="middle">
                                                        <td align="right" width="20%" class="field-name">Ответственный:</td>
                                                        <td align="left" width="80%"><?= $arResult["RESPONSINLE_USER"]["NAME"]; ?> <?= $arResult["RESPONSINLE_USER"]["LAST_NAME"]; ?></td>
                                                    </tr>                                                                                                        
                                                    <? endif; ?>
                                                    <? if (count($arResult["SUBSCRIBERS"])): ?>
                                                    <tr valign="middle">
                                                        <td align="right" width="20%" class="field-name">Подписаны:</td>
                                                        <td align="left" width="80%">
                                                            <? 
                                                            $n = 0;
                                                            foreach($arResult["SUBSCRIBERS"] as $user)
                                                            {
                                                                if ($n++)
                                                                    echo ", ";
                                                                echo $user["NAME"]." ".$user["LAST_NAME"];
                                                            }
                                                            ?>
                                                        </td>
                                                    </tr>                                        
                                                    <? endif; ?>
                                                    <? if ($arResult["CLOSED"]): ?>
                                                    <tr valign="middle">
                                                        <td align="right" class="field-name">Закрыто:</td>
                                                        <td><?= $arResult["DATE_CLOSE"]; ?>&nbsp;&nbsp;&nbsp;<?= $arResult["NAME_CLOSE"]["NAME"]; ?> <?= $arResult["NAME_CLOSE"]["LAST_NAME"]; ?></td>
                                                    </tr>
                                                    <? endif; ?>
                                                </table>
                                                </div>
                                                <div style="width: 50%; float: left;">
                                                <table cellpadding="0" cellspacing="0" border="0" class="support-edit-table" id="edit1_edit_table">
                                                    <? if ($arParams["USE_PROJECT"]=="Y"): ?>
                                                    <tr>
                                                        <td align="right" width="20%" class="field-name">Проект:</td>
                                                        <td align="left" width="80%"><?= $arResult["PROJECT_NAME"]; ?></td>
                                                    </tr>
                                                    <? endif; ?>
                                                    <tr valign="middle">
                                                        <td align="right" width="20%" class="field-name">Категория:</td>
                                                        <td align="left" width="80%"><?= $arResult["CATEGORY_NAME"]; ?></td>
                                                    </tr>
                                                    <tr valign="middle">
                                                        <td align="right" width="20%" class="field-name">Статус:</td>
                                                        <td align="left" width="80%"><?= $arResult["STATUS_NAME"]; ?></td>
                                                    </tr>
                                                    <tr valign="middle">
                                                        <td align="right" width="20%" class="field-name">Критичность:</td>
                                                        <td align="left" width="80%"><?= $arResult["CRITICALITY_NAME"]; ?></td>
                                                    </tr>
                                                </table>
                                                </div>                                                
                                            </td>
                                        
                                        <tr class="heading"><td colspan="2">Обсуждение</td></tr>
	
                                        <tr valign="top">
                                            <td colspan="2">
                                                <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                                    <tr>
                                                        <td></td>
                                                        <td></td>
                                                    </tr>
                                                    <!-- ******************************************** -->
                                                    <!-- с этого места идут записи из Хода исполнения -->
                                                    <!-- ******************************************** -->
                                                    <? if (count($arResult["LOGS"])): ?>

                                                        <? $n = 1; ?>
                                                        <? foreach ($arResult["LOGS"] as $log): ?>
                                                    <tr>
                                                        <td align="center" colspan="2" width="100%" style="padding:6px 3px;">
                                                            <table border="0" cellspacing="0" cellpadding="0" class="defaultborder" width="100%">
                                                                <tr>
                                                                    <td style="background-color:<?= $log["BGCOLOR"]; ?>;" width="100%">
									<table border="0" width="100%" cellspacing="0" cellpadding="0">
                                                                            <tr>
                                                                                <td style="<?if (!$log["SYSTEM"]):?>border-bottom: 1px solid lightgray;<?endif;?>padding:4px;background-color:<?= $log["BGCOLOR"]; ?>;"><!--b>#&nbsp;<?//= ($n); ?></b>&nbsp;&nbsp;&nbsp;--><?= $log["DATE_CREATE"]; ?>&nbsp;&nbsp;&nbsp;<?= $log["CREATOR"]; ?><? if ($log["IS_SUPPORT"]): ?>&nbsp;(<span class="supportrequired">техподдержка</span>)<? endif; ?><? if ($log["HIDDEN"]): ?>&nbsp;&nbsp;&nbsp;<span style="color:#2F9567">[скрытое]</span><? elseif ($log["SYSTEM"]): ?>&nbsp;&nbsp;&nbsp;<span style="color:#939300">[лог]</span><? endif; ?></td>
                                                                                <td align="right" style="<?if (!$log["SYSTEM"]):?>border-bottom: 1px solid lightgray;<?endif;?>padding:4px;background-color:<?= $log["BGCOLOR"]; ?>;"><? if (!$log["SYSTEM"]): ?><a href="#postform" onmousedown="javascript:SupQuoteMessage('quotetd<?= $log["ID"]; ?>')" title="Цитировать выделенный фрагмент сообщения">Цитировать</a><? endif; ?></td>
                                                                            </tr>
                                                                            <tr><td colspan="2" height="1" style="background-color:<?= $log["BGCOLOR"]; ?>;"></td></tr>
                                                                            <? if (is_array($log["PROPERTIES"]["FILE"]["VALUE"])): ?>
                                                                            <tr> 
                                                                                <td colspan="2" style="padding:8px; background-color:<?= $log["BGCOLOR"]; ?>;">
                                                                                    <table cellspacing="0" cellpadding="0" width="0%">
                                                                                        <? foreach ($log["PROPERTIES"]["FILE"]["VALUE"] as $value): ?>
                                                                                        <tr>
                                                                                            <td style="background-color:<?= $log["BGCOLOR"]; ?>;" valign="top" width="0%" nowrap=""><img src="/bitrix/images/support/paperclip.gif" width="16" height="16" border="0" alt=""></td>
                                                                                            <td style="background-color:<?= $log["BGCOLOR"]; ?>;" width="0%" nowrap=""><a title="Посмотреть файл" target="_blank" href="<?= $value["SRC"]; ?>"><?= $value["FILE_NAME"]; ?></a> (<?= $value["FILE_SIZE_TEXT"]; ?>)&nbsp;</td>
                                                                                            <td style="background-color:<?= $log["BGCOLOR"]; ?>;" width="0%" nowrap="">[&nbsp;<a title="Скачать файл &quot;<?= $value["FILE_NAME"]; ?>&quot;" href="<?= $value["SRC"]; ?>">скачать</a>&nbsp;]<br></td>
                                                                                        </tr>
                                                                                        <? endforeach; ?>
                                                                                    </table>
                                                                                </td>
                                                                            </tr>
                                                                            <tr><td colspan="2" height="1" style="background-color:<?= $log["BGCOLOR"]; ?>;"></td></tr>
                                                                            <? endif; ?>                                                                            
                                                                            <tr> 
                                                                                <td class="tdlogtext" colspan="2" id="quotetd<?= $log["ID"]; ?>" style="padding:8px;background-color:<?= $log["BGCOLOR"]; ?>;">
                                                                                    <?= $log["PREVIEW_TEXT"]; ?>
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </td>
                                                    </tr>                                                    
                                                        <? $n++; ?>
                                                        <? endforeach; ?>    

                                                    <? endif; ?>
                                                    
                                                    <tr>
                                                        <td></td>
                                                        <td></td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>

                                        <tr class="heading"><td colspan="2">Ответ<a name="postform"></a></td></tr>
	
                                    <? if (!$arResult["CLOSED"]): ?>
                                        <? if ($arResult["ISPERFORMER"]||$arResult["ISADMIN"]): ?>
                                        <tr valign="top"> 
                                            <td align="right">Сообщение скрыть,<br />автора не оповещать:</td>
                                            <td valign="center"><input type="checkbox" OnClick="HiddenClick()" id="HIDDEN" name="HIDDEN" id="HIDDEN" value="Y"><br /></td>
                                        </tr>
                                        <? endif; ?>
                                        <!--tr valign="top"> 
                                            <td align="right">Не изменять статус обращения:</td>
                                            <td valign="center"><input type="checkbox" id="NOT_CHANGE_STATUS" name="NOT_CHANGE_STATUS" id="NOT_CHANGE_STATUS" value="Y"></td>
                                        </tr-->
	
	
        <!-- ********************** выбор шаблона ответа ******************************************* -->
        <!--script type="text/javascript">
	var answers= new Array();
	function OnChangeFUA_ID()
	{
		var value;
		value = answers[document.form1.FUA_ID[document.form1.FUA_ID.selectedIndex].value];
		if (value && value.length>0) document.form1.MESSAGE.value += value;
		
	}
        </script>

	<tr valign="middle">
		<td id="edit_5" align="right">Шаблон ответа:</td>
		<td id="edit_6"><select OnChange="OnChangeFUA_ID()" id="FUA_ID" name="FUA_ID" id="FUA_ID" size="1"><option value="NOT_REF">нет</option></select></td>
	</tr-->
                                    
                                        <tr valign="top"> 
                                            <td align="right">
                                                <table cellspacing="0" cellpadding="0" border="0" width="100%">
                                                    <tr>
                                                        <td>&nbsp;</td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">Текст ответа:</td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td style="padding: 0px">
                                                <table cellspacing="0" cellpadding="0" border="0" width="100%">
                                                    <tr>
                                                        <td valign="bottom" class="form_but">
                                                            <input type="button" accesskey="b" value="B" onClick="insert_tag('B', document.form1.MESSAGE)" style="vertical-align: middle; width: 25px; font-weight:bold" name="B" id="B" title="Жирный текст (alt + b)">
                                                            <input type="button" accesskey="i" value="I" onClick="insert_tag('I', document.form1.MESSAGE)" style="vertical-align: middle; width: 25px; font-style:italic" name="I" id="I" title="Курсивный текст (alt + i)">
                                                            <input type="button" accesskey="u" value="U" onClick="insert_tag('U', document.form1.MESSAGE)" style="vertical-align: middle; width: 25px; text-decoration:underline" name="U" id="U" title="Текст с нижним подчеркиванием (alt + u)">
                                                            <input type="button" accesskey="q" value="Цитата (alt+q)" onClick="insert_tag('QUOTE', document.form1.MESSAGE)" style="vertical-align: middle; width: 100px" name="QUOTE" id="QUOTE" title="Оформление текста в виде цитаты (alt + q)">
                                                            <input type="button" accesskey="c" value="Код (alt+c)" onClick="insert_tag('CODE', document.form1.MESSAGE)" style="vertical-align: middle; width: 100px" name="CODE" id="CODE" title="Оформление текста в виде кода (alt + c)">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td><textarea name="MESSAGE" id="MESSAGE" style="width:99%;height:300px;"  wrap="virtual"></textarea></td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    
                                        <tr valign="top">
                                            <td align="right">Прикрепить файлы:</td>
                                            <td style="padding:0px" nowrap>
                                                <input type="hidden" name="lastfile" id="lastfile" value="1" />
                                                <div id="fileslist">
                                                    <input type="file" onchange="addNewRow(this)" name="file_1_" id="file_1_" /><br />
                                                </div>
                                            </td>
                                        </tr>
                                    <? endif; ?>

                                    <? if (($arParams["USE_PROJECT"]=="Y") && ($arResult["ISPERFORMER"]||$arResult["ISADMIN"]||$arResult["ISCREATOR"])) : ?>
                                    <tr valign="middle">
                                        <td align="right">Проект:</td>
                                        <td>
                                            <select  id ="PROJECT_ID" name='PROJECT_ID' id='PROJECT_ID' size='1'>
                                                <option value=""> </option>
                                                <? foreach($arResult["HANDBOOKS"]["PROJECT"] as $item): ?>                                                    
                                                <option <?= ($item["ID"]==$arResult["PROPERTY_PROJECT_VALUE"])?"selected":""; ?> value="<?= $item["ID"]; ?>"><?= $item["NAME"]; ?></option>
                                                <? endforeach; ?>
                                            </select>
                                        </td>
                                    </tr>
                                    <? endif; ?>
                                        
                                    <? if ($arResult["ISPERFORMER"]||$arResult["ISADMIN"]): ?>
                                        <!-- ****** связь категорий с ответственным по умолчанию ******* -->
                                        <script type="text/javascript">
                                        <!--
                                            var arCategory_RESP = Array();
                                            <? foreach($arResult["HANDBOOKS"]["CATEGORY"] as $item): ?>
                                            arCategory_RESP[<?= $item["ID"]; ?>] = <?= $item["PROPERTY_DEFAULT_RESPONSIBLE_VALUE"]; ?>;
                                            <? endforeach; ?>
                                        //-->
                                        </script>	
                                        
                                        <tr valign="middle">
                                            <td align="right">Категория:</td>
                                            <td>
                                                <select  id ="CATEGORY_ID" name='CATEGORY_ID' size='1'>
                                                    <option value=""> </option>
                                                    <? foreach($arResult["HANDBOOKS"]["CATEGORY"] as $item): ?>                                                    
                                                    <option <?= ($item["ID"]==$arResult["PROPERTY_CATEGORY_VALUE"])?"selected":""; ?> value="<?= $item["ID"]; ?>"><?= $item["NAME"]; ?></option>
                                                    <? endforeach; ?>
                                                </select>&nbsp;&nbsp;<a title="Установить ответственного сотрудника по умолчанию для выбранной категории." id="icon_1" href="javascript:SetResponsible('CATEGORY_ID')"><img src="/bitrix/images/support/resp.gif" width="16" height="16" border="0" alt="Установить ответственного сотрудника по умолчанию для выбранной категории."></a>
                                            </td>
                                        </tr>
                                        
                                        <tr valign="middle">
                                            <td align="right" nowrap>Ответственный:</td>
                                            <td nowrap>
                                                <select id="RESPONSIBLE_USER_ID" name="RESPONSIBLE_USER_ID" size="1">
                                                    <option value="NOT_REF"> </option>
                                                    <? foreach($arResult["PERFORMERS"] as $item): ?>
                                                    <option <?= ($item["ID"]==$arResult["PROPERTY_RESPONSIBLE_USER_VALUE"])?"selected":""; ?> value="<?= $item["ID"]; ?>"><?= $item["NAME"]; ?> <?= $item["LAST_NAME"]; ?></option>
                                                    <? endforeach; ?>
                                                </select>
                                            </td>
                                        </tr>
                                        
                                        <tr valign="middle">
                                            <td align="right" nowrap>Статус:</td>
                                            <td nowrap>
                                                <select  id="STATUS_ID" name='STATUS_ID' size='1'>
                                                    <option value=""> </option>
                                                    <? foreach($arResult["HANDBOOKS"]["STATUSES"] as $item): ?>                                                    
                                                    <option <?= ($item["ID"]==$arResult["PROPERTY_STATUS_VALUE"])?"selected":""; ?> value="<?= $item["ID"]; ?>"><?= $item["NAME"]; ?></option>
                                                    <? endforeach; ?>
                                                </select>
                                            </td>
                                        </tr>
                                    
                                        <tr valign="middle">
                                            <td align="right" nowrap>Уровень сложности:</td>
                                            <td nowrap>
                                                <select id="DIFFICULTY_ID" name='DIFFICULTY_ID' size='1'>
                                                    <option value=""> </option>
                                                    <? foreach($arResult["HANDBOOKS"]["DIFFICULTY"] as $item): ?>                                                    
                                                    <option <?= ($item["ID"]==$arResult["PROPERTY_DIFFICULTY_VALUE"])?"selected":""; ?> value="<?= $item["ID"]; ?>"><?= $item["NAME"]; ?></option>
                                                    <? endforeach; ?>
                                                </select>
                                            </td>
                                        </tr>	
                                    <? endif; ?>
                                        
                                    <? if ($arResult["ISPERFORMER"]||$arResult["ISADMIN"]||$arResult["ISCREATOR"]): ?>
                                        <tr valign="middle">
                                            <td align="right">Критичность:</td>
                                            <td>
                                                <select  id="CRITICALITY_ID" name='CRITICALITY_ID' size='1'>
                                                    <option value=""> </option>
                                                    <? foreach($arResult["HANDBOOKS"]["CRITICALITY"] as $item): ?>                                                    
                                                    <option <?= ($item["ID"]==$arResult["PROPERTY_CRITICALITY_VALUE"])?"selected":""; ?> value="<?= $item["ID"]; ?>"><?= $item["NAME"]; ?></option>
                                                    <? endforeach; ?>
                                                </select>
                                            </td>
                                        </tr>
                                    <? endif; ?>
                                        
                                    <? if ($arResult["ISCREATOR"]): ?>                                        
                                        <tr valign="middle">
                                            <td align="right" nowrap>Оценка ответов:</td>
                                            <td nowrap>
                                                <select id="MARK_ID" name="MARK_ID" size="1">
                                                    <option value=""> </option>
                                                    <? foreach($arResult["HANDBOOKS"]["MARK"] as $item): ?>                                                    
                                                    <option <?= ($item["ID"]==$arResult["PROPERTY_MARK_VALUE"])?"selected":""; ?> value="<?= $item["ID"]; ?>"><?= $item["NAME"]; ?></option>
                                                    <? endforeach; ?>
                                                </select>
                                            </td>
                                        </tr>
                                    <? endif; ?>
                                        
                                        <!--tr>
                                            <td align="right">Время решения (мин.):</td>
                                            <td><input type="text" name="TASK_TIME" id="TASK_TIME" size="7" maxlength="10" value=""></td>
                                        </tr-->

                                    <? if ($arResult["ISPERFORMER"]||$arResult["ISADMIN"]||$arResult["ISCREATOR"]): ?>
                                    <? if ($arResult["CLOSED"]): ?>
                                        <tr valign="middle">
                                            <td align="right" nowrap>Открыть обращение:</td>
                                            <td nowrap><input type="checkbox" id="OPEN" name="OPEN" value="Y"></td>
                                        </tr>                                        
                                    <? else: ?>
                                        <tr valign="middle">
                                            <td id="edit_24" align="right" nowrap>Закрыть обращение:</td>
                                            <td id="edit_25" nowrap><input type="checkbox" id="CLOSE" name="CLOSE" value="Y"></td>
                                        </tr>                                        
                                    <? endif; ?>
                                    <? endif; ?>
                                        
                                    <? if ($arResult["ISPERFORMER"]||$arResult["ISADMIN"]): ?>
                                        <tr valign="middle">
                                            <td align="right" nowrap>База знаний:</td>
                                            <td nowrap>
                                                <select id="TO_WIKI_ID" name="TO_WIKI_ID" size="1">
                                                    <option value=""> </option>
                                                    <? foreach($arResult["HANDBOOKS"]["TO_WIKI"] as $item): ?>                                                    
                                                    <option <?= ($item["ID"]==$arResult["PROPERTY_TO_WIKI_ENUM_ID"])?"selected":""; ?> value="<?= $item["ID"]; ?>"><?= $item["VALUE"]; ?></option>
                                                    <? endforeach; ?>
                                                </select>
                                            </td>
                                        </tr>
                                    <? endif; ?>
                                    </table>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
                <div class="buttons">
                    <input type="submit" name="save" value="Сохранить" title="Сохранить и вернуться" />
                    <input type="submit" name="apply" value="Применить" title="Сохранить и остаться в форме" />
                    <input type="button" value="Отменить" name="cancel" onClick="window.location='index.php'" title="Не сохранять и вернуться" />
                    <? if ($arResult["SHOW_SUBSCRIBE"]=="1"): ?>
                    <div style="float:right;"><input type="submit" name="subscribe" value="Подписаться" title="Подписаться на обновления и остаться в форме" /></div>
                    <? elseif ($arResult["SHOW_SUBSCRIBE"]=="2"): ?>
                        <div style="float:right;"><input type="submit" name="unsubscribe" value="Отписаться" title="Отписаться от обновлений и остаться в форме" /></div>
                    <? endif; ?>
                </div>
            </td>
            <td class="right"><div class="empty"></div></td>
	</tr>
	<tr class="bottom">
            <td class="left"><div class="empty"></div></td>
            <td><div class="empty"></div></td>
            <td class="right"><div class="empty"></div></td>
	</tr>
    </table>
</div>


<script language="javascript">
<!--
HiddenClick();
//-->
</script>

</form>




<?/* if ($arResult["CAN_COMMENT"]): ?>
<div class="spacer h20"></div>

<h2>Добавить комментарий</h2>
<form action="" method="POST">
    <input type="hidden" name="FORMTYPE" value="addcomment" />
    <input type="hidden" name="REQUEST_ID" value="<?= $arResult["ID"]; ?>" />
    <textarea name="comment"></textarea><br />
    <? if ($arResult["ISADMIN"] || $arResult["ISPERFORMER"]): ?>
        <input type="checkbox" name="hidden">Скрытый комментарий</input>
    <? endif; ?>
    <input type="submit" value="Отправить" />    
</form>

<? endif; */?>

